package br.com.paysmart.experiments.jni;

public class JNITest
{

	// Native functions
	protected native final int Native_DoLoopedWork(int iInputValue, int iLoopCount);
	
	private void LoadSystemLibraries()
	{
		System.loadLibrary("jni-test");  // Java will add .dll or lib.so
	}

	public JNITest()
	{
		try
		{
			System.out.println("Loading native libraries.");
			LoadSystemLibraries();
			System.out.println("Library loaded successfully");
		}
		catch (Exception e)
		{
			System.out.println("Problems loading JNITest: " + e.toString());
			e.printStackTrace();
		}
	}

	public int DoLoopedWork(int iInputValue, int iLoopCount)
	{
		return Native_DoLoopedWork(iInputValue, iLoopCount);
	}
}

